<?php

class Application_Model_PlayerStats extends Zend_Db_Table_Abstract
{
	protected $_roundSettings = "round_settings";
	protected $_race = "race";
	protected $_class = "hero_class";
	protected $_userStats = "user_stats";
		
	function getPlayerStats($user_id)
    {
    	
    	$select = $this->_db->select()
             ->from(array('us' => $this->_userStats))
             ->join(array('rs' => $this->_roundSettings), 'us.user_fk = rs.user_fk', array('alias'))
             ->join(array('c' => $this->_class), 'rs.class_fk = c.id', array('class_name'=>'name'))
             ->join(array('r' => $this->_race), 'rs.race_fk = r.id', array('race_name'=>'name'))
             ->where('us.user_fk=?',$user_id);

        $result = $this->getAdapter()->fetchRow($select);
    	return $result;
    }
    
}

